Skip to content

Conversation

crepererum
Copy link
Collaborator

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it need a test too? Or maybe fuzzing is sufficient

let chunk_length = u32::from_be_bytes(buf_chunk_length) as usize;
let bytes_left = cursor_content.len() - (cursor.position() as usize);
if chunk_length > bytes_left {
// do NOT try to allocate massive buffer for `chunk_data` but instead fail early
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@domodwyer domodwyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more spam!

@crepererum
Copy link
Collaborator Author

Does it need a test too?

I think I can extract a test case 👍

@crepererum crepererum force-pushed the crepererum/fix_snappy_oom branch from a0b76ad to 5f597bd Compare May 30, 2022 15:14
@crepererum
Copy link
Collaborator Author

added a test

@crepererum crepererum added the automerge Instruct kodiak to merge the PR label May 30, 2022
@kodiakhq kodiakhq bot merged commit 822186d into main May 30, 2022
@kodiakhq kodiakhq bot deleted the crepererum/fix_snappy_oom branch May 30, 2022 15:18
]
.to_vec();

let err = RecordBatchBody::read(&mut Cursor::new(data)).unwrap_err();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Instruct kodiak to merge the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants